<template>
  <div class="admin">
    <van-field-dict v-model="name" maskType="name" label="姓名" placeholder="请输入姓名"/>
    <van-button type="info" size="large" @click="handleGoHome">返回首页</van-button>
    <van-button style="margin-top: 24px" type="info" size="large" @click="handleLogout">退出登录</van-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      name: ""
    }
  },
  methods: {
    handleGoHome() {
      const data = {
        action: "$router",
        loadData: {
          funcName: "push",
          funcItem: "/dashboard"
        }
      }
      window.top.postMessage(data, "*")
    },
    handleLogout() {
      const data = {
        action: "logout",
        loadData: {}
      }
      window.top.postMessage(data, "*")
    }
  }
}
</script>
<style scoped>
.admin {
  padding: 12px;
}
</style>